package cn.edu.nju.software.zp13.core.nodeDescriptorGenerator;

import java.lang.reflect.Field;
import java.lang.reflect.Method;

import cn.edu.nju.software.zp13.core.annotation.Element;
import cn.edu.nju.software.zp13.core.annotation.HasTag;
import cn.edu.nju.software.zp13.core.nodeDescriptor.NodeDescriptor;
import cn.edu.nju.software.zp13.core.nodeDescriptor.NodeType;
import cn.edu.nju.software.zp13.core.xmlNodeEntity.XmlNodeEntity;

public class ArrayComplexNodeDescriptorGenerator extends ElementNodeDescriptorGenerator implements NodeDescriptorGenerator{
	
	public ArrayComplexNodeDescriptorGenerator(Element elementAnnotation, Field f) {
		super(elementAnnotation, f);
	}

	@Override
	public NodeDescriptor generateNodeDescriptor(Field f, Method[] methods, XmlNodeEntity entity) {
		NodeDescriptor nd=new NodeDescriptor();
		nd.setEntity(entity);
		nd.setType(NodeType.ArrayComplexNode);
		nd.setField(f);
		if(elementAnnotation.hasExtraTag()==HasTag.no){
			nd.setNodeName(null);
		}else{
			nd.setNodeName(tagName);
		}
		return nd;
	}
	
}
